<!DOCTYPE html>
<html lang="en">

<?php render('application',"header"); ?>
<body>
<?php render('application',"navbar"); ?>
<div class="container">
    <div class="row">
        <div class="col-lg-8 col-md-12">
            <div class="well well-sm">
                <?php
                    //$movies=new movie();
                    $moviescount=$movies->count();
                    if($moviescount>0){
                        echo '<table>';
                        foreach($movies->fetch(0, 20) as $movie){
                            echo '<tr><td>'.$movie['id'].'</td><td>'.$movie['name'].'</td><td>';
                            $cast=$movies->person->count($movie['id']);
                            if($cast>0){
                                foreach($movies->person->fetch(0,20,$movie['id']) as $person){
                                    echo '<p>'.$person['name'];
                                    $abc=$movies->person->addressbook->count($person['id']);
                                    if($abc>0){
                                        echo '<ul>';
                                        foreach($movies->person->addressbook->fetch(0,20,$person['id']) as $ab){
                                            echo '<li>'.$ab['line1'].'</li>';
                                        }
                                        echo '</ul>';
                                    }
                                    echo '</p>';
                                }
                            }
                        echo '</td><td>';
                    echo '</td></tr>';
                    }
                    echo '</table>';
                    }
                ?>
            </div>
        </div>
        <div class="col-lg-4 lg-only">
            <div class="well well-sm">
                Large Ads
            </div>
        </div>
        <div class="col-md-12 md-only">
            <div class="well well-sm">
                Medium Ads
            </div>
        </div>        
        <div class="col-sm-12 sm-only">
            <div class="well well-sm">
                Small Ads
            </div>
        </div>        
        
    </div>
</div>

<?php render('application',"footer"); ?>
</body>
</html>